package com.stt.experiment.trynetty.runner;

import com.stt.experiment.trynetty.server.NettyServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 启动服务
 */
@Slf4j
@Component
public class ServerRunner implements CommandLineRunner {

    @Autowired
    private NettyServer nettyServer;

    @Override
    public void run(String... strings) throws Exception {
        Thread thread = new Thread(nettyServer);
        thread.start();
    }
}
